package com.hl.card.modular.pack.controller;

import com.hl.card.common.persistence.model.Shortcuts;
import com.hl.card.modular.pack.service.ShortCutsService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/shortcuts")
public class ShortCutsController {

     @Resource
     private ShortCutsService shortCutsService;


     @RequestMapping(value = "/queryShortcuts",method = RequestMethod.POST)
      public Object queryShortcuts(String regiserTime){
         Map<String,Object> map = new HashMap<>();
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
         map.put("regiserTime",regiserTime);
         map.put("today",format.format(new Date()));

         List<Shortcuts> list = shortCutsService.selectListByCondition(map);

         return list;
      }




}
